<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Insert title here</title>
    <link href="http://back.zbswzn.cn/login/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="http://back.zbswzn.cn/login/bootstrap-theme.css" rel="stylesheet" type="text/css"/>
    <link href="http://back.zbswzn.cn/login/elegant-icons-style.css" rel="stylesheet" type="text/css"/>
    <link href="http://back.zbswzn.cn/login/font-awesome.css" rel="stylesheet" type="text/css"/>
    <link href="http://back.zbswzn.cn/login/style.css" rel="stylesheet" type="text/css"/>
    <link href="http://back.zbswzn.cn/login/style-responsive.css" rel="stylesheet" type="text/css"/>
    <script src="http://back.zbswzn.cn/js/jquery.js" type="text/javascript"></script>
</head>
<!-- 页面需要注意，所有的标签都必须要有结束标签，不然做为Thymeleaf模板会出错 -->
<body>
<table class="table table-striped">
    <caption>任务</caption>
    <tr>
        <td>id</td>
        <td>名字</td>
    </tr>
    <tr>
        <td th:text="${task.id}"></td>
        <td th:text="${task.name}"></td>
    </tr>
</table>
<br/>
<table class="table table-striped">
    <caption>任务节点</caption>
    <tr>
        <td>节点Id</td>
        <td>任务Id</td>
        <td>节点名字</td>
        <td>处理函数</td>
        <td>查询Sql</td>
        <td>查询数据源</td>
        <td>排序值</td>
        <td>操作</td>
    </tr>
    <tr th:each="tn:${taskNode}">
        <td th:text="${tn.id}"></td>
        <td th:text="${tn.taskId}"></td>
        <td th:text="${tn.taskNodeName}"></td>
        <td th:text="${tn.handFunction}"></td>
        <td th:text="${tn.querySql}"></td>
        <td th:text="${tn.dataSource}"></td>
        <td th:text="${tn.orderValue}"></td>
        <td>
            <a th:href="@{'/task/taskNode/del/' + ${tn.id}}">删除</a> |
            <a th:href="@{'/task/detail/' + ${task.id}+'?taskNodeId='+${tn.id}}">修改</a>
        </td>

    </tr>
</table>
<br/>
<form id="iform" th:action="@{'/task/taskNode/add'}" th:method="post">
    <table class="table table-striped">
        <tr>
            <td>Id</td>
            <td><input type="text" name="id" th:value="${targetTaskNode?.id}" class="idReadly"/></td>
        </tr>

        <tr>
            <td>任务Id</td>
            <td><input type="text" name="taskId" th:value="${task.id}" class="idReadly"/></td>
        </tr>
        <tr>
            <td>节点名字</td>
            <td><input type="text" name="taskNodeName" th:value="${targetTaskNode?.taskNodeName}"/></td>
        </tr>

        <tr>
            <td>查询sql</td>
            <td><input type="text" name="querySql" th:value="${targetTaskNode?.querySql}"/></td>
        </tr>
        <tr>
            <td>处理函数</td>
            <td>
                <textarea type="text" name="handFunction"
                          th:inline="text"
                          style="max-width:400px;max-height:200px;min-width:400px;min-height:200px;">
[[${targetTaskNode?.handFunction}]]
                </textarea>

            </td>
        </tr>
        <tr>
            <td>排序值</td>
            <td><input type="text" name="orderValue" th:value="${targetTaskNode?.orderValue}"/></td>
        </tr>

        <tr>
            <td>
                提交
            </td>
            <td><input type="submit" value="提交"/></td>
        </tr>
    </table>
</form>
<script>

    $(function () {
        $(".idReadly").attr("readonly", "readonly")
    })

</script>
</body>
</html>